﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Mines.Ajax.Test.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script src="//cdn.bootcss.com/jquery/1.12.3/jquery.min.js"></script>
    <script type="text/javascript" src="<%=Mines.Ajax.Common.GetAjaxUrl<Mines.Ajax.Test.GetFun>() %>"></script>
    <script type="text/javascript">
        $(function () {
            $(".submit").click(function () {
                var i1 = $(".i1").val()-0;
                var i2 = $(".i2").val()-0;
                if (isNaN(i1)) {
                    $(".i1").focus();
                } else if (isNaN(i2)) {
                    $(".i2").focus();
                } else {
                    GetFun.Sum([i1, i2], function (res) {
                        if (res && res.value) {
                            $(".sum").val(res.value)
                        }
                    })
                }
            });
            $(".submit1").click(function () {
                var input1 = $(".name").val();
                GetFun.Welcome(input1, function (res) {
                    if (res && res.value) {
                        $(".res").html(res.value);
                    }
                })
            })
        });
    </script>
    <title></title>
</head>
<body>
    <div>
        简单的加法后台运算：<br />
    <input class="i1" />+<input class="i2" />=<input class="submit" type="button" value="计算" /><br /><input class="sum" />
        <br /><br /><br /><br /><br />
        Session 操作：<br />
        输入您的名字：
        <input class="name" /><input class="submit1" type="button" value="提交" />
        <div class="res"></div>
    </div>
</body>
</html>
